package com.bcx.crm.mapper.docTemplateMapper;

/**
 * Created by ys on 2018/3/21.
 */
public enum State {
//    edit("edit","编辑"),
//    approving("approving","审核中"),
//    approved("approved","已审核"),
//    stop("stop","已拒绝");
    edit(1,"编辑"),
    approving(2,"审核中"),
    approved(3,"已审核"),
    stop(4,"已拒绝");

    private int stateCode;
    private String stateName;

    State(int stateCode, String stateName){
        this.stateCode = stateCode;
        this.stateName = stateName;
    }

    public int getStateCode() {
        return stateCode;
    }

    public void setStateCode(int stateCode) {
        this.stateCode = stateCode;
    }

    public String getStateName() {
        return stateName;
    }

    public void setStateName(String stateName) {
        this.stateName = stateName;
    }

    public static State getState(String state){
        if (state.equals("edit")){
            return edit;
        }
        if (state.equals("approving")){
            return approving;
        }
        if (state.equals("approved")){
            return approved;
        }
        if (state.equals("stop")){
            return stop;
        }
        return null;
    }
}
